package com.alan.cueencoding.error;

import com.alan.cueencoding.util.Result;
import com.alibaba.fastjson.JSONObject;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

import java.time.LocalDateTime;

/**
 * @author Alan.Xiao
 * @date 2022/10/4
 */
@RestControllerAdvice
public class GlobalExceptionAdvice {

    @ExceptionHandler(value = RuntimeException.class)
    public <T> Result<T> runtimeException(RuntimeException exception) {
        return Result.fail(exception.getMessage());
    }
}
